<!DOCTYPE html>
<html lang="en" class="ui-mode-light">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" >

    <meta name="theme-color" content="#000000">

    <link rel="chrome-webstore-item"
          href="https://chrome.google.com/webstore/detail/jkfdkjomocoaljglgddnmhcbolldcafd">

    <meta name="google-site-verification" content="j5BBM8XbyOumZOvUQGaej0asCNz6NERVdssDydibUl0" />
    <link rel="apple-touch-icon" href="/apple-touch-icon.png">

    <link rel="manifest" href="/manifest.json">

    <link rel="icon" href="/icon.ico">

    <!-- TODO: these need to load locally before we enable firebase in production -->
    <script src="/node_modules/firebase/firebase.js"></script>
    <script src="/node_modules/firebaseui/dist/firebaseui.js"></script>
    <link rel="stylesheet" href="/node_modules/firebaseui/dist/firebaseui.css" />

    <link rel="stylesheet" href="/node_modules/react-table/react-table.css">

    <link rel="stylesheet" href="/node_modules/bootstrap/dist/css/bootstrap.min.css">
    <link rel="stylesheet" href="/node_modules/bootstrap/dist/css/bootstrap-grid.min.css">
    <link rel="stylesheet" href="/node_modules/bootstrap/dist/css/bootstrap-reboot.min.css">

    <link rel="stylesheet" href="/node_modules/toastr/build/toastr.min.css">

    <link rel="stylesheet" href="/pdfviewer-custom/flexbar.css">
    <link rel="stylesheet" href="/pdfviewer-custom/progress.css">
    <link rel="stylesheet" href="/pdfviewer-custom/typography.css">
    <link rel="stylesheet" href="/pdfviewer-custom/toaster.css">
    <link rel="stylesheet" href="/pdfviewer-custom/twitter-bootstrap.css">
    <link rel="stylesheet" href="/pdfviewer-custom/reviewer.css">
    <link rel="stylesheet" href="/pdfviewer-custom/pricing.css">
    <link rel="stylesheet" href="/pdfviewer-custom/ui-mode.css">
    <link rel="stylesheet" href="/node_modules/@fortawesome/fontawesome-free/css/all.min.css">
    <link rel="stylesheet" href="/node_modules/@burtonator/react-dropdown/dist/react-dropdown.css">

    <link rel="stylesheet" href="/apps/repository/css/index.css">
    <link rel="stylesheet" href="/apps/repository/css/light-theme.css">
<!--    <link rel="stylesheet" href="/node_modules/polar-dark-mode/src/index.css">-->

    <title>Polar: Document Repository</title>

    <meta name="description" content="A powerful document manager for Mac, Windows, and Linux for managing web content, books, and notes and supports tagging, annotation, highlighting and keeps track of your reading progress." />
    <!-- TODO: use react-helmet to set canonical and other properties here when we -->
    <!-- use SSR-->
    <!-- <link rel="canonical" href="https://app.getpolarized.io/" />-->

    <meta property="og:description" content="A powerful document manager for Mac, Windows, and Linux for managing web content, books, and notes and supports tagging, annotation, highlighting and keeps track of your reading progress." />
    <meta property="og:url" content="https://app.getpolarized.io/" />
    <meta property="og:site_name" content="POLAR - Easily manage your PDFs, web content, and notes." />
    <meta property="og:image" content="https://getpolarized.io/assets/logo/icon.png" />
    <meta name="twitter:image" content="https://getpolarized.io/assets/logo/icon.png">
    <meta name="twitter:card"  content="summary">
    <meta name="twitter:description" content="A powerful document manager for Mac, Windows, and Linux for managing web content, books, and notes and supports tagging, annotation, highlighting and keeps track of your reading progress.">
    <meta name="twitter:title" content="POLAR - Easily manage your reading.  Tag, annotate, and highlight PDFs and web content.">
    <meta name="twitter:site" content="@getpolarized">

  </head>
  <body>

    <noscript>

      <a href="https://getpolarized.io/">Polar</a> allows you to easily manage
      your PDFs, web content, and notes and supports advanced features like
      <a href="https://app.getpolarized.io/groups">group sharing</a> of
      documents.

    </noscript>

    <div id="root" style="height: 100%; width: 100%; display: flex;">

      <div id="error" class="alert alert-danger m-1"
           style="display: none;"
           role="alert">

      </div>

      <div id="loading-v1"
           style="display: flex; position: absolute; left: 0; top: 0; width: 100vw; height: 100vh;">
        <!-- a simple loading widget -->

        <div style="margin: auto; ">
          <img class="logo" width="250" height="250" src="/icon.svg"/>
        </div>

      </div>

    </div>

  </body>

  <script src="/apps/service-worker-registration.js"></script>
  <script src="/apps/init.js"></script>

  <script>

      function displayError(msg) {

          // TODO: we need to also include the error stack trace in the future I think.

          const errorElement = document.getElementById("error");
          errorElement.style.display = 'block';
          errorElement.textContent = msg;

      }

      function withErrorHandler(delegate) {

          try {

            delegate();

          } catch (e) {
            displayError(e.message);
          }

      }

      const fallbackLoader = () => {

          withErrorHandler(() => {

            // REQUIRE_ENTRY_POINT: there seems to be an Electron bug where when
            // loading over HTTP we can't find node_modules until we require().  We can
            // only find standard modules like 'fs' and 'electron' but not custom
            // modules so we have to just have these four lines repeated over and over
            // for each of our main apps.  In the future we should try to track down
            // why this is happening but I spent 1-2 hours on trying to figure out
            // the root cause with no resolution and this is a temporary workaround.
            const {remote} = require('electron');
            const path = require('path');
            const appPath = remote.getGlobal("appPath");
            require(path.join(appPath, "apps", "repository", "js", "entry.js"));

          });

      };

      injectApp('/web/dist/repository-bundle.js', fallbackLoader);

  </script>

</html>
